﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using easyccms.BusinessLayer.Entities;
using easyccms.BusinessLayer.Repositories;
using easyccms.WebUI.Infrastructure;

namespace easyccms.WebUI.Controllers
{
    public class ArticlesController : Controller
    {

        private IArticleRepository articleRepository
        {
            get { return DependencyInjector.Resolve<IArticleRepository>(); }
        }
        //
        // GET: /Article/12

        /// <summary>
        /// Articles the specified article id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        public ActionResult Article(int id)
        {
            Article articleToView = articleRepository.All.FirstOrDefault(x => x.ArticleId == id);
            return View(articleToView);
        }

    }
}
